/*
 Navicat Premium Data Transfer

 Source Server         : 118.89.234.135
 Source Server Type    : MySQL
 Source Server Version : 50732
 Source Host           : 118.89.234.135:3306
 Source Schema         : boblog

 Target Server Type    : MySQL
 Target Server Version : 50732
 File Encoding         : 65001

 Date: 21/06/2021 15:10:27
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nickname` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '管理员昵称',
  `email` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '管理员邮箱',
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '管理员密码',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of admin
-- ----------------------------
BEGIN;
INSERT INTO `admin` VALUES (2, 'admin@gmail.com', 'admin@gmail.com', '$2a$10$u7KX8Exnu7DuRe06gazq3ezYd2qu.ePi7sfXyFOjdowfzTjvmtv.m', '2021-06-21 04:37:46', '2021-06-21 04:37:46', NULL);
COMMIT;

-- ----------------------------
-- Table structure for advertise
-- ----------------------------
DROP TABLE IF EXISTS `advertise`;
CREATE TABLE `advertise` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '广告标题',
  `link` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '广告链接',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of advertise
-- ----------------------------
BEGIN;
INSERT INTO `advertise` VALUES (1, '博客', 'https://bingyu123.gitee.io/blog/', '2021-06-21 13:02:00', '2021-06-21 13:02:00', NULL);
INSERT INTO `advertise` VALUES (2, '面试题', 'https://bingyu123.gitee.io/ztjy-technology/', '2021-06-21 15:07:14', '2021-06-21 15:07:14', NULL);
COMMIT;

-- ----------------------------
-- Table structure for article
-- ----------------------------
DROP TABLE IF EXISTS `article`;
CREATE TABLE `article` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文章标题',
  `author` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT '梁凤波' COMMENT '文章作者',
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文章内容',
  `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文章简介',
  `keyword` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0' COMMENT '文章关键字',
  `cover` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文章封面',
  `browse` int(11) DEFAULT '0' COMMENT '文章浏览次数',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `deleted_at` datetime DEFAULT NULL,
  `category_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `category_id` (`category_id`),
  CONSTRAINT `article_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of article
-- ----------------------------
BEGIN;
INSERT INTO `article` VALUES (1, 'hello', 'test', '哈哈哈 测试啊', 'test', 'js', 'http://resource.cuilb.cn/Fj4cyUotQG_76dUeIYupVduzPwM-', 3, '2021-06-21 13:18:12', '2021-06-21 13:41:35', NULL, 1);
INSERT INTO `article` VALUES (2, 'git的简单使用', 'bingyu', '# 课堂笔记\n\n1. 姓名\n2. 爱好\n\n实训一：\n\n1. 表达能力 \n2. 学习能力\n3. 解决问题能力 \n\n\n\n表达能力\n\n1. 10分钟  http://bingyu123.gitee.io/ztjy-technology \n   1. ppt \n   2. 代码 5分钟 \n   3. 总结 \n\n学习能力/ 解决问题能力\n\n2. 项目 面向百度编程 \n   1. 难点 搜索 关键字高亮\n   2. 解决问题的能力 禅道  \n   3. 文档 每周六 答辩 \n\n0-1 项目上线 \n\n1. vue / react / node \n2. git \n3. 打包 小 webpack / vite \n4. 测试上线地址 (服务器) \n5. 真正的服务器 (服务器)  腾讯云/阿里云 15天/15天 学生 10块钱 http: 1min \n6. cdn加速 七牛云 图片 js css  域名(备案)  \n7. https : 安全\n8. pc/移动   域名解析  二级域名\n9. linux \n10. nginx : 负载均衡 / 高可用 / 动静结合 / 反向代理 / 域名解析 / https \n11. https://域名.com  速度 快\n12. 测试 : 禅道 / 明道\n\n\n\n\n\n## 过程\n\n1. vue3开发\n2. git 协作\n3. 后台  \n   1. 后台管理\n   2. 博客项目  \n4. 0-1 上线 \n\n\n\n接到项目\n\n### git\n\n```js\ngit init 初始化\ngit add -A add .  添加到缓存\ngit commit -m \'描述\' 添加到本地仓库\ngit remote add origin 地址 //添加远程地址\ngit push origin 分支名字 推送到远程\ngit pull origin 分支名字 从远程拉取\ngit checkout 分支 切换分支\ngit branch 分支 创建分支\ngit branch -av 显示分支\ngit reset --hard hash 重置版本\ngit log 显示日志\ngit status 查看git状态\ngit merge 合并  \n	本地 git merge 本地的分支\n  远程 git merge origin/master\n```\n\n步骤\n\n1. 远程仓库\n\n2. A同学 初始化仓库 添加远程地址\n\n   ```bash\n   bogon:A sairitsutakara$ git init \n   已初始化空的 Git 仓库于 /Users/sairitsutakara/project/web/classCode/2006A/code/day210621/A/.git/\n   bogon:A sairitsutakara$ git add .\n   bogon:A sairitsutakara$ git commit -m \'init项目\'\n   [master（根提交） 12564bf] init项目\n    1 file changed, 1 insertion(+)\n    create mode 100644 vue3/app.js\n   bogon:A sairitsutakara$ git remote add origin https://gitee.com/bingyu123/test2006.git\n   bogon:A sairitsutakara$ git remote -v\n   origin	https://gitee.com/bingyu123/test2006.git (fetch)\n   origin	https://gitee.com/bingyu123/test2006.git (push)\n   bogon:A sairitsutakara$ git push origin master\n   枚举对象: 4, 完成.\n   对象计数中: 100% (4/4), 完成.\n   写入对象中: 100% (4/4), 280 字节 | 280.00 KiB/s, 完成.\n   总共 4（差异 0），复用 0（差异 0），包复用 0\n   remote: Powered by GITEE.COM [GNK-5.0]\n   To https://gitee.com/bingyu123/test2006.git\n    * [new branch]      master -&gt; master\n   bogon:A sairitsutakara$ \n   \n   ```\n\n3. 其中一个人将基础代码 推送到远程仓库\n\n4. 另外一个人拉取\n\n   ```bash\n   bogon:B sairitsutakara$ git clone https://gitee.com/bingyu123/test2006.git\n   正克隆到 \'test2006\'...\n   remote: Enumerating objects: 4, done.\n   remote: Counting objects: 100% (4/4), done.\n   remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0\n   接收对象中: 100% (4/4), 完成.\n   bogon:B sairitsutakara$ \n   ```\n\n5. 分支系统 \n\n   1. master : 版本分支 1.0 1.1 1.1.3\n   2. dev : 开发分支\n   3. 组内人员表较多 每个人都有一个分支 (3个人以上)\n   4. feture : 功能分支 临时分支 销毁\n   5. test: 分支 测试  临时分支 销毁\n   6. proproduction : 预发分支 临时分支 销毁\n\n   ```bash\n   bogon:A sairitsutakara$ git checkout -b dev\n   切换到一个新分支 \'dev\'\n   bogon:A sairitsutakara$ git push\n   fatal: 当前分支 dev 没有对应的上游分支。\n   为推送当前分支并建立与远程上游的跟踪，使用\n   \n       git push --set-upstream origin dev\n   \n   bogon:A sairitsutakara$ git push origin dev\n   总共 0（差异 0），复用 0（差异 0），包复用 0\n   remote: Powered by GITEE.COM [GNK-5.0]\n   remote: Create a pull request for \'dev\' on Gitee by visiting:\n   remote:     https://gitee.com/bingyu123/test2006/pull/new/bingyu123:dev...bingyu123:master\n   To https://gitee.com/bingyu123/test2006.git\n    * [new branch]      dev -&gt; dev\n   bogon:A sairitsutakara$ \n   ```\n\n ![image20210621095224008.png](1)\n\n   ```bash\n   bogon:B sairitsutakara$ git pull \n   fatal: 不是一个 git 仓库（或者任何父目录）：.git\n   bogon:B sairitsutakara$ cd test2006/\n   bogon:test2006 sairitsutakara$ git pull\n   来自 https://gitee.com/bingyu123/test2006\n    * [新分支]          dev        -&gt; origin/dev\n   已经是最新的。\n   bogon:test2006 sairitsutakara$ \n   ```\n\n6. 一个人推  另外一个人拉 \n\n   ```bash\n   bogon:A sairitsutakara$ git add .\n   bogon:A sairitsutakara$ git commit -m \'add log\'\n   [dev e464e5b] add log\n    1 file changed, 4 insertions(+)\n   bogon:A sairitsutakara$ git push origin dev\n   枚举对象: 7, 完成.\n   对象计数中: 100% (7/7), 完成.\n   使用 16 个线程进行压缩\n   压缩对象中: 100% (2/2), 完成.\n   写入对象中: 100% (4/4), 300 字节 | 300.00 KiB/s, 完成.\n   总共 4（差异 0），复用 0（差异 0），包复用 0\n   remote: Powered by GITEE.COM [GNK-5.0]\n   To https://gitee.com/bingyu123/test2006.git\n      12564bf..e464e5b  dev -&gt; dev\n   bogon:A sairitsutakara$ \n   ```\n\n   ```bash\n   bogon:test2006 sairitsutakara$ git branch -av\n   * master                12564bf init项目\n     remotes/origin/HEAD   -&gt; origin/master\n     remotes/origin/dev    12564bf init项目\n     remotes/origin/master 12564bf init项目\n   bogon:test2006 sairitsutakara$ git checkout -b dev\n   切换到一个新分支 \'dev\'\n   bogon:test2006 sairitsutakara$ git branch -av\n   * dev                   12564bf init项目\n     master                12564bf init项目\n     remotes/origin/HEAD   -&gt; origin/master\n     remotes/origin/dev    12564bf init项目\n     remotes/origin/master 12564bf init项目\n   bogon:test2006 sairitsutakara$ git pull origin dev\n   remote: Enumerating objects: 7, done.\n   remote: Counting objects: 100% (7/7), done.\n   remote: Compressing objects: 100% (2/2), done.\n   remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0\n   展开对象中: 100% (4/4), 280 字节 | 70.00 KiB/s, 完成.\n   来自 https://gitee.com/bingyu123/test2006\n    * branch            dev        -&gt; FETCH_HEAD\n      12564bf..e464e5b  dev        -&gt; origin/dev\n   更新 12564bf..e464e5b\n   Fast-forward\n    vue3/app.js | 4 ++++\n    1 file changed, 4 insertions(+)\n   bogon:test2006 sairitsutakara$ \n   ```\n\n7. 如果出现问题 merge\n\n   A\n\n   ```bash\n   bogon:A sairitsutakara$ git add .\n   bogon:A sairitsutakara$ git commit -m \'A写了东西\'\n   [dev 77f0c63] A写了东西\n    1 file changed, 1 insertion(+)\n   bogon:A sairitsutakara$ git push origin dev\n   枚举对象: 7, 完成.\n   对象计数中: 100% (7/7), 完成.\n   使用 16 个线程进行压缩\n   压缩对象中: 100% (2/2), 完成.\n   写入对象中: 100% (4/4), 363 字节 | 363.00 KiB/s, 完成.\n   总共 4（差异 1），复用 0（差异 0），包复用 0\n   remote: Powered by GITEE.COM [GNK-5.0]\n   To https://gitee.com/bingyu123/test2006.git\n      3b6380a..77f0c63  dev -&gt; dev\n   bogon:A sairitsutakara$ \n   ```\n\n   B 也提交\n\n   ```bash\n   bogon:test2006 sairitsutakara$ git add .\n   bogon:test2006 sairitsutakara$ git commit -m \'B dev\'\n   [dev b268074] B dev\n    1 file changed, 1 insertion(+)\n   bogon:test2006 sairitsutakara$ git push origin dev\n   To https://gitee.com/bingyu123/test2006.git\n    ! [rejected]        dev -&gt; dev (fetch first)\n   error: 推送一些引用到 \'https://gitee.com/bingyu123/test2006.git\' 失败\n   提示：更新被拒绝，因为远程仓库包含您本地尚不存在的提交。这通常是因为另外\n   提示：一个仓库已向该引用进行了推送。再次推送前，您可能需要先整合远程变更\n   提示：（如 \'git pull ...\'）。\n   提示：详见 \'git push --help\' 中的 \'Note about fast-forwards\' 小节。\n   bogon:test2006 sairitsutakara$ git pull origin dev\n   来自 https://gitee.com/bingyu123/test2006\n    * branch            dev        -&gt; FETCH_HEAD\n   自动合并 vue3/app.js\n   冲突（内容）：合并冲突于 vue3/app.js\n   自动合并失败，修正冲突然后提交修正的结果。\n   bogon:test2006 sairitsutakara$ \n   ```\n\n   此时B查看冲突代码\n\n   ```bash\n   &lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD   本地显示\n   console.log(\'我是B 我写了东西\');\n   ======= 往下是远程的代码\n   console.log(\'我是A 我写了东西\');\n   &gt;&gt;&gt;&gt;&gt;&gt;&gt; 77f0c631687a540db4be8cf664dbef588d934653\n   ```\n\n   修改后\n\n   ```bash\n   console.log(\'我是B 我写了东西\');\n   console.log(\'我是A 我写了东西\');\n   ```\n\n   重新提交\n\n   ```bash\n   bogon:test2006 sairitsutakara$ git add .\n   bogon:test2006 sairitsutakara$ git commit -m \'解决冲突\'\n   [dev c8971c1] 解决冲突\n   bogon:test2006 sairitsutakara$ git push origin dev\n   枚举对象: 14, 完成.\n   对象计数中: 100% (14/14), 完成.\n   使用 16 个线程进行压缩\n   压缩对象中: 100% (4/4), 完成.\n   写入对象中: 100% (8/8), 626 字节 | 626.00 KiB/s, 完成.\n   总共 8（差异 2），复用 0（差异 0），包复用 0\n   remote: Powered by GITEE.COM [GNK-5.0]\n   To https://gitee.com/bingyu123/test2006.git\n      77f0c63..c8971c1  dev -&gt; dev\n   bogon:test2006 sairitsutakara$ git status\n   位于分支 dev\n   无文件要提交，干净的工作区\n   bogon:test2006 sairitsutakara$ \n   ```\n\n   A要拉取一下\n\n   ```bash\n   bogon:A sairitsutakara$ git pull origin dev\n   remote: Enumerating objects: 14, done.\n   remote: Counting objects: 100% (14/14), done.\n   remote: Compressing objects: 100% (4/4), done.\n   remote: Total 8 (delta 2), reused 0 (delta 0), pack-reused 0\n   展开对象中: 100% (8/8), 606 字节 | 86.00 KiB/s, 完成.\n   来自 https://gitee.com/bingyu123/test2006\n    * branch            dev        -&gt; FETCH_HEAD\n      77f0c63..c8971c1  dev        -&gt; origin/dev\n   更新 77f0c63..c8971c1\n   Fast-forward\n    vue3/app.js | 1 +\n    1 file changed, 1 insertion(+)\n   bogon:A sairitsutakara$ \n   ```\n\n   ## 项目\n   \n   1. 从仓库拉取\n   2. 导入数据库\n   3. 修改host 和 密码\n   4. 安装redis\n   5. 安装依赖包\n   6. 启动查看项目\n\n\n', '这是git的简单使用', 'git git教程', 'http://resource.cuilb.cn/lpEalWjHNsbHl6Tvfgne8wye2G3y', 2, '2021-06-21 15:03:24', '2021-06-21 15:04:22', NULL, 1);
COMMIT;

-- ----------------------------
-- Table structure for category
-- ----------------------------
DROP TABLE IF EXISTS `category`;
CREATE TABLE `category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '分类名称',
  `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '分类关键字',
  `parent_id` int(11) DEFAULT '0' COMMENT '分类父级ID，默认为0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of category
-- ----------------------------
BEGIN;
INSERT INTO `category` VALUES (1, 'js', 'javascript', 0, '2021-06-21 13:01:26', '2021-06-21 13:01:26', NULL);
INSERT INTO `category` VALUES (2, '工具类', '工具', 0, '2021-06-21 15:06:07', '2021-06-21 15:06:07', NULL);
COMMIT;

-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `target_id` int(11) NOT NULL COMMENT '评论目标id, 如普通文章，专栏的文章id',
  `target_type` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '评论目标类型, 如article, column',
  `nickname` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '评论人的名字',
  `email` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '评论人的邮箱',
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '评论内容',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of comment
-- ----------------------------
BEGIN;
INSERT INTO `comment` VALUES (1, 1, 'article', 'bingyu', 'cuilibao@gmail.com', 'hello', '2021-06-21 13:24:22', '2021-06-21 13:24:22', NULL);
INSERT INTO `comment` VALUES (2, 1, 'article', '11', '123@qwe.com', '111', '2021-06-21 13:41:57', '2021-06-21 13:41:57', NULL);
INSERT INTO `comment` VALUES (3, 2, 'article', '冰雨', 'admin@gmail.com', '好棒啊', '2021-06-21 15:03:59', '2021-06-21 15:03:59', NULL);
INSERT INTO `comment` VALUES (4, 2, 'article', '哈哈', 'qwe@123.com', '哈哈哈', '2021-06-21 15:05:28', '2021-06-21 15:05:28', NULL);
COMMIT;

-- ----------------------------
-- Table structure for reply
-- ----------------------------
DROP TABLE IF EXISTS `reply`;
CREATE TABLE `reply` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nickname` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '回复人的名字',
  `email` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '回复人的邮箱',
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '回复内容',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime NOT NULL,
  `deleted_at` datetime DEFAULT NULL,
  `comment_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `comment_id` (`comment_id`),
  CONSTRAINT `reply_ibfk_1` FOREIGN KEY (`comment_id`) REFERENCES `comment` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of reply
-- ----------------------------
BEGIN;
INSERT INTO `reply` VALUES (1, 'xinmei', 'xin@123.com', 'hello', '2021-06-21 13:24:44', '2021-06-21 13:24:44', NULL, 1);
INSERT INTO `reply` VALUES (2, 'xiaoxin', '123@123.com', '哈哈', '2021-06-21 15:04:22', '2021-06-21 15:04:22', NULL, 3);
INSERT INTO `reply` VALUES (3, '哈哈', 'qwe@123.com', '请问这个git文档图片咋了', '2021-06-21 15:04:58', '2021-06-21 15:04:58', NULL, 3);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
